<h2>
   <span style="float: right;">
      <%= button_for "Back to List", "list", {:action => 'index'} %>
      <%= button_for "Delete", "delete", { :action => 'transfer', :id => @user } %>
      <%= button_for 'Edit', "edit", { :action => 'edit', :id => @user } %>
   </span>
   Profile
</h2>
<h1><%= @user.name -%></h1>
<p><strong>Email: </strong><%= mail_to @user.email, @user.email, :encode => "javascript" %></p>

<h2>Profile Picture</h2>
<p>
   <%= image_tag @user.photo %>
</p>

<h2>Author of</h2>
<p>
   <ul class="data_list">
      <%= render :partial => "list_item", :collection => @user.authored.reverse %>
   </ul>
</p>

<h2>
   <span style = "float: right;">
      <% restrict_to "admin | photos" do -%>
         <%= button_for "Grant New Permission", "add", { :controller => 'permissions', :action => 'new', :user_id => @user } %>
      <% end -%>
   </span>
   Permissions
</h2>
<p>
   <ul class="data_list">
      <% @user.permissions.each do |permission| -%>
         <li class="<%= cycle('odd','even', :name => "permissions") %>"><%= link_to( permission, {:controller => "permissions", :action => 'show', :id => permission, :user_id => @user}, :class => 'permission') %></li>
      <% end -%>
   </ul>
</p>